package com.ourcraft.informationcollectionsystem.controller.test;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ourcraft.informationcollectionsystem.entity.User;
import com.ourcraft.informationcollectionsystem.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.management.Query;
import java.util.List;

@RestController
public class UserDBController {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/listAllUsers")
    public List<User> query() {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("usename","myk");
        List<User> users = userMapper.selectList(queryWrapper);
//        System.out.println(users);
        return users;
    }
}
